package org.ax.service.plan.imple;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.ax.mapper.plan.TaskMapper;
import org.ax.pojo.plan.Task;
import org.ax.pojo.plan.Work;
import org.ax.service.plan.TaskService;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * 编程人:赵浩鑫
 * 时间:2021-02-25-14:44
 */
@Service
public class ITaskService extends ServiceImpl<TaskMapper, Task> implements TaskService {

    @Override
    public Page<Task> searchTaskPage(Page page) {
        return getBaseMapper().selectPage(page, null);
    }

    @Override
    public boolean addTask(Task task) {
        return getBaseMapper().insert(task)>0;
    }

    @Override
    public boolean updTask(Task task) {
        return getBaseMapper().updateById(task)>0;
    }

    @Override
    public boolean deletesTask(String[] ids) {
        return getBaseMapper().deleteBatchIds(Arrays.asList(ids))>0;
    }

    @Override
    public Task toTaskId(String id) {
        return getBaseMapper().selectById(id);
    }

    @Override
    public List<Task> selectTasks() {
        return getBaseMapper().selectList(null);
    }
}
